/*******************************************************************************
 * Copyright (c) 2022 BestSolution.at and others.
 *  
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v.2.0 which is available at
 * https://www.eclipse.org/legal/epl-2.0.
 *  
 * SPDX-License-Identifier: EPL-2.0
 *  
 * Contributors:
 *     BestSolution.at - initial API and implementation
 *******************************************************************************/
/*
 * generated by Xtext
 */
package org.eclipse.fx.code.editor.ldef.serializer;

import com.google.inject.Inject;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.fx.code.editor.ldef.services.LDefGrammarAccess;
import org.eclipse.xtext.IGrammarAccess;
import org.eclipse.xtext.RuleCall;
import org.eclipse.xtext.nodemodel.INode;
import org.eclipse.xtext.serializer.analysis.GrammarAlias.AbstractElementAlias;
import org.eclipse.xtext.serializer.analysis.GrammarAlias.TokenAlias;
import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynNavigable;
import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynTransition;
import org.eclipse.xtext.serializer.sequencer.AbstractSyntacticSequencer;

@SuppressWarnings("all")
public class LDefSyntacticSequencer extends AbstractSyntacticSequencer {

	protected LDefGrammarAccess grammarAccess;
	protected AbstractElementAlias match_Partition_SingleLineRule_EqualsSignGreaterThanSignKeyword_5_0_q;
	protected AbstractElementAlias match_Scanner_SingleLineRule_EqualsSignGreaterThanSignKeyword_4_0_q;
	
	@Inject
	protected void init(IGrammarAccess access) {
		grammarAccess = (LDefGrammarAccess) access;
		match_Partition_SingleLineRule_EqualsSignGreaterThanSignKeyword_5_0_q = new TokenAlias(false, true, grammarAccess.getPartition_SingleLineRuleAccess().getEqualsSignGreaterThanSignKeyword_5_0());
		match_Scanner_SingleLineRule_EqualsSignGreaterThanSignKeyword_4_0_q = new TokenAlias(false, true, grammarAccess.getScanner_SingleLineRuleAccess().getEqualsSignGreaterThanSignKeyword_4_0());
	}
	
	@Override
	protected String getUnassignedRuleCallToken(EObject semanticObject, RuleCall ruleCall, INode node) {
		return "";
	}
	
	
	@Override
	protected void emitUnassignedTokens(EObject semanticObject, ISynTransition transition, INode fromNode, INode toNode) {
		if (transition.getAmbiguousSyntaxes().isEmpty()) return;
		List<INode> transitionNodes = collectNodes(fromNode, toNode);
		for (AbstractElementAlias syntax : transition.getAmbiguousSyntaxes()) {
			List<INode> syntaxNodes = getNodesFor(transitionNodes, syntax);
			if (match_Partition_SingleLineRule_EqualsSignGreaterThanSignKeyword_5_0_q.equals(syntax))
				emit_Partition_SingleLineRule_EqualsSignGreaterThanSignKeyword_5_0_q(semanticObject, getLastNavigableState(), syntaxNodes);
			else if (match_Scanner_SingleLineRule_EqualsSignGreaterThanSignKeyword_4_0_q.equals(syntax))
				emit_Scanner_SingleLineRule_EqualsSignGreaterThanSignKeyword_4_0_q(semanticObject, getLastNavigableState(), syntaxNodes);
			else acceptNodes(getLastNavigableState(), syntaxNodes);
		}
	}

	/**
	 * Ambiguous syntax:
	 *     '=>'?
	 *
	 * This ambiguous syntax occurs at:
	 *     check=Check (ambiguity) 'escaped' 'by' escapeSeq=STRING
	 *     check=Check (ambiguity) (rule end)
	 *     startSeq=STRING (ambiguity) 'escaped' 'by' escapeSeq=STRING
	 *     startSeq=STRING (ambiguity) (rule end)
	 *     startSuffix=STRING (ambiguity) 'escaped' 'by' escapeSeq=STRING
	 *     startSuffix=STRING (ambiguity) (rule end)
	 */
	protected void emit_Partition_SingleLineRule_EqualsSignGreaterThanSignKeyword_5_0_q(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {
		acceptNodes(transition, nodes);
	}
	
	/**
	 * Ambiguous syntax:
	 *     '=>'?
	 *
	 * This ambiguous syntax occurs at:
	 *     check=Check (ambiguity) 'enabledif' enabledIf=ScannerCondition
	 *     check=Check (ambiguity) 'escaped' 'by' escapeSeq=STRING
	 *     check=Check (ambiguity) (rule end)
	 *     startSeq=STRING (ambiguity) 'enabledif' enabledIf=ScannerCondition
	 *     startSeq=STRING (ambiguity) 'escaped' 'by' escapeSeq=STRING
	 *     startSeq=STRING (ambiguity) (rule end)
	 *     startSuffix=STRING (ambiguity) 'enabledif' enabledIf=ScannerCondition
	 *     startSuffix=STRING (ambiguity) 'escaped' 'by' escapeSeq=STRING
	 *     startSuffix=STRING (ambiguity) (rule end)
	 */
	protected void emit_Scanner_SingleLineRule_EqualsSignGreaterThanSignKeyword_4_0_q(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {
		acceptNodes(transition, nodes);
	}
	
}
